package c2.advanced.server.controller;

import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;

public class ControllerTool {

    public static Object R(Supplier supplier) {
        Map<String, Object> map = new HashMap<>();
        long beginTime = System.currentTimeMillis();
        Object body = supplier.get();
        map.put("耗时", System.currentTimeMillis()-beginTime);
        map.put("执行结果", body);
        return map;
    }
}
